package com.vx.vxbug.controllers;

import com.vx.vxbug.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.vx.vxbug.services.ProgramService;

@Controller
@RequestMapping("/")
public class IndexController {

	@Autowired
	private ProgramService pS;

    @Autowired
    private UserService uS;

	@RequestMapping(method = RequestMethod.GET)
	public String welcome(Model model) {

        model.addAttribute("programs", pS.getAllPrograms());

        model.addAttribute("users", uS.getAllUsers());
		return "index";
	}
}
